Integrand size = 41, antiderivative size = 71 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {3 A x}{8 a^2 c^2}+\frac {3 A \cos (e+f x) \sin (e+f x)}{8 a^2 c^2 f}-\frac {\cos ^4(e+f x) (B-A \tan (e+f x))}{4 a^2 c^2 f} \]
3/8*A*x/a^2/c^2+3/8*A*cos(f*x+e)*sin(f*x+e)/a^2/c^2/f-1/4*cos(f*x+e)^4*(B- A*tan(f*x+e))/a^2/c^2/f
Time = 0.17 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.75 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {-8 B \cos ^4(e+f x)+A (12 (e+f x)+8 \sin (2 (e+f x))+\sin (4 (e+f x)))}{32 a^2 c^2 f} \]
(-8*B*Cos[e + f*x]^4 + A*(12*(e + f*x) + 8*Sin[2*(e + f*x)] + Sin[4*(e + f *x)]))/(32*a^2*c^2*f)
Time = 0.32 (sec) , antiderivative size = 77, normalized size of antiderivative = 1.08, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {3042, 4071, 27, 82, 454, 215, 216}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2}dx\) |
\(\Big \downarrow \) 4071 |
\(\displaystyle \frac {a c \int \frac {A+B \tan (e+f x)}{a^3 c^3 (1-i \tan (e+f x))^3 (i \tan (e+f x)+1)^3}d\tan (e+f x)}{f}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\int \frac {A+B \tan (e+f x)}{(1-i \tan (e+f x))^3 (i \tan (e+f x)+1)^3}d\tan (e+f x)}{a^2 c^2 f}\) |
\(\Big \downarrow \) 82 |
\(\displaystyle \frac {\int \frac {A+B \tan (e+f x)}{\left (\tan ^2(e+f x)+1\right )^3}d\tan (e+f x)}{a^2 c^2 f}\) |
\(\Big \downarrow \) 454 |
\(\displaystyle \frac {\frac {3}{4} A \int \frac {1}{\left (\tan ^2(e+f x)+1\right )^2}d\tan (e+f x)-\frac {B-A \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{a^2 c^2 f}\) |
\(\Big \downarrow \) 215 |
\(\displaystyle \frac {\frac {3}{4} A \left (\frac {1}{2} \int \frac {1}{\tan ^2(e+f x)+1}d\tan (e+f x)+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )-\frac {B-A \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{a^2 c^2 f}\) |
\(\Big \downarrow \) 216 |
\(\displaystyle \frac {\frac {3}{4} A \left (\frac {1}{2} \arctan (\tan (e+f x))+\frac {\tan (e+f x)}{2 \left (\tan ^2(e+f x)+1\right )}\right )-\frac {B-A \tan (e+f x)}{4 \left (\tan ^2(e+f x)+1\right )^2}}{a^2 c^2 f}\) |
(-1/4*(B - A*Tan[e + f*x])/(1 + Tan[e + f*x]^2)^2 + (3*A*(ArcTan[Tan[e + f *x]]/2 + Tan[e + f*x]/(2*(1 + Tan[e + f*x]^2))))/4)/(a^2*c^2*f)
3.8.23.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_))^(m_.)*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_) )^(p_.), x_] :> Int[(a*c + b*d*x^2)^m*(e + f*x)^p, x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && EqQ[b*c + a*d, 0] && EqQ[n, m] && IntegerQ[m]
Int[((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^2)^(p + 1) /(2*a*(p + 1))), x] + Simp[(2*p + 3)/(2*a*(p + 1)) Int[(a + b*x^2)^(p + 1 ), x], x] /; FreeQ[{a, b}, x] && LtQ[p, -1] && (IntegerQ[4*p] || IntegerQ[6 *p])
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a , 0] || GtQ[b, 0])
Int[((c_) + (d_.)*(x_))*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((a*d - b*c*x)/(2*a*b*(p + 1)))*(a + b*x^2)^(p + 1), x] + Simp[c*((2*p + 3)/(2*a *(p + 1))) Int[(a + b*x^2)^(p + 1), x], x] /; FreeQ[{a, b, c, d}, x] && L tQ[p, -1] && NeQ[p, -3/2]
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si mp[a*(c/f) Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x], x , Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]
Time = 0.15 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.35
method | result | size |
risch | \(\frac {3 A x}{8 a^{2} c^{2}}-\frac {B \cos \left (4 f x +4 e \right )}{32 a^{2} c^{2} f}+\frac {A \sin \left (4 f x +4 e \right )}{32 a^{2} c^{2} f}-\frac {B \cos \left (2 f x +2 e \right )}{8 a^{2} c^{2} f}+\frac {A \sin \left (2 f x +2 e \right )}{4 a^{2} c^{2} f}\) | \(96\) |
norman | \(\frac {\frac {3 A x}{8 a c}-\frac {B}{4 a c f}+\frac {5 A \tan \left (f x +e \right )}{8 a c f}+\frac {3 A \tan \left (f x +e \right )^{3}}{8 a c f}+\frac {3 A x \tan \left (f x +e \right )^{2}}{4 a c}+\frac {3 A x \tan \left (f x +e \right )^{4}}{8 a c}}{\left (1+\tan \left (f x +e \right )^{2}\right )^{2} a c}\) | \(117\) |
derivativedivides | \(\frac {3 A}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {i B}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i A}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {B}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {3 A \arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{2} c^{2}}+\frac {3 A}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )}-\frac {i B}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )}+\frac {i A}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}+\frac {B}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}\) | \(209\) |
default | \(\frac {3 A}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )}+\frac {i B}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )}-\frac {i A}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {B}{16 f \,a^{2} c^{2} \left (-i+\tan \left (f x +e \right )\right )^{2}}+\frac {3 A \arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{2} c^{2}}+\frac {3 A}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )}-\frac {i B}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )}+\frac {i A}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}+\frac {B}{16 f \,a^{2} c^{2} \left (i+\tan \left (f x +e \right )\right )^{2}}\) | \(209\) |
3/8*A*x/a^2/c^2-1/32*B/a^2/c^2/f*cos(4*f*x+4*e)+1/32*A/a^2/c^2/f*sin(4*f*x +4*e)-1/8*B/a^2/c^2/f*cos(2*f*x+2*e)+1/4*A/a^2/c^2/f*sin(2*f*x+2*e)
Result contains complex when optimal does not.
Time = 0.25 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.27 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {{\left (24 \, A f x e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (-i \, A - B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} - 4 \, {\left (2 i \, A + B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 4 \, {\left (-2 i \, A + B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, A - B\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{64 \, a^{2} c^{2} f} \]
1/64*(24*A*f*x*e^(4*I*f*x + 4*I*e) + (-I*A - B)*e^(8*I*f*x + 8*I*e) - 4*(2 *I*A + B)*e^(6*I*f*x + 6*I*e) - 4*(-2*I*A + B)*e^(2*I*f*x + 2*I*e) + I*A - B)*e^(-4*I*f*x - 4*I*e)/(a^2*c^2*f)
Time = 0.34 (sec) , antiderivative size = 360, normalized size of antiderivative = 5.07 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {3 A x}{8 a^{2} c^{2}} + \begin {cases} \frac {\left (\left (16384 i A a^{6} c^{6} f^{3} e^{2 i e} - 16384 B a^{6} c^{6} f^{3} e^{2 i e}\right ) e^{- 4 i f x} + \left (131072 i A a^{6} c^{6} f^{3} e^{4 i e} - 65536 B a^{6} c^{6} f^{3} e^{4 i e}\right ) e^{- 2 i f x} + \left (- 131072 i A a^{6} c^{6} f^{3} e^{8 i e} - 65536 B a^{6} c^{6} f^{3} e^{8 i e}\right ) e^{2 i f x} + \left (- 16384 i A a^{6} c^{6} f^{3} e^{10 i e} - 16384 B a^{6} c^{6} f^{3} e^{10 i e}\right ) e^{4 i f x}\right ) e^{- 6 i e}}{1048576 a^{8} c^{8} f^{4}} & \text {for}\: a^{8} c^{8} f^{4} e^{6 i e} \neq 0 \\x \left (- \frac {3 A}{8 a^{2} c^{2}} + \frac {\left (A e^{8 i e} + 4 A e^{6 i e} + 6 A e^{4 i e} + 4 A e^{2 i e} + A - i B e^{8 i e} - 2 i B e^{6 i e} + 2 i B e^{2 i e} + i B\right ) e^{- 4 i e}}{16 a^{2} c^{2}}\right ) & \text {otherwise} \end {cases} \]
3*A*x/(8*a**2*c**2) + Piecewise((((16384*I*A*a**6*c**6*f**3*exp(2*I*e) - 1 6384*B*a**6*c**6*f**3*exp(2*I*e))*exp(-4*I*f*x) + (131072*I*A*a**6*c**6*f* *3*exp(4*I*e) - 65536*B*a**6*c**6*f**3*exp(4*I*e))*exp(-2*I*f*x) + (-13107 2*I*A*a**6*c**6*f**3*exp(8*I*e) - 65536*B*a**6*c**6*f**3*exp(8*I*e))*exp(2 *I*f*x) + (-16384*I*A*a**6*c**6*f**3*exp(10*I*e) - 16384*B*a**6*c**6*f**3* exp(10*I*e))*exp(4*I*f*x))*exp(-6*I*e)/(1048576*a**8*c**8*f**4), Ne(a**8*c **8*f**4*exp(6*I*e), 0)), (x*(-3*A/(8*a**2*c**2) + (A*exp(8*I*e) + 4*A*exp (6*I*e) + 6*A*exp(4*I*e) + 4*A*exp(2*I*e) + A - I*B*exp(8*I*e) - 2*I*B*exp (6*I*e) + 2*I*B*exp(2*I*e) + I*B)*exp(-4*I*e)/(16*a**2*c**2)), True))
Exception generated. \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \]
Time = 0.56 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.89 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {\frac {3 \, {\left (f x + e\right )} A}{a^{2} c^{2}} + \frac {3 \, A \tan \left (f x + e\right )^{3} + 5 \, A \tan \left (f x + e\right ) - 2 \, B}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{2} a^{2} c^{2}}}{8 \, f} \]
1/8*(3*(f*x + e)*A/(a^2*c^2) + (3*A*tan(f*x + e)^3 + 5*A*tan(f*x + e) - 2* B)/((tan(f*x + e)^2 + 1)^2*a^2*c^2))/f
Time = 8.62 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.75 \[ \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^2} \, dx=\frac {3\,A\,x}{8\,a^2\,c^2}+\frac {{\cos \left (e+f\,x\right )}^4\,\left (\frac {3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^3}{8}+\frac {5\,A\,\mathrm {tan}\left (e+f\,x\right )}{8}-\frac {B}{4}\right )}{a^2\,c^2\,f} \]